﻿#region "Copyright (C) Lenny Granovsky. 2011-2013"
//    This library provides extended cache capabilities to the ASP.NET applications.
//
//                Copyright (C) Lenny Granovsky. 2011-2013. 
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//    This program comes with ABSOLUTELY NO WARRANTY.
//    This is free software, and you are welcome to redistribute it
//    under certain conditions;
#endregion

using System;

namespace FlexiCache
{
    /// <summary>
    /// The interface that should be implemented by the class providing SessionOnDemand functionality to the application.
    /// </summary>
    public interface ISessionOnDemandController
    {
        /// <summary>
        /// Method adds data into session on demand storage with specified key.
        /// </summary>
        /// <param name="key">Data key.</param>
        /// <param name="value">Data to store.</param>
        void Add(string key, object value);
        /// <summary>
        /// Method clears all items in the session on demand storage.
        /// </summary>
        void Clear();
        /// <summary>
        /// Method gets a data from the session on demand storage using specified key.
        /// </summary>
        /// <param name="key">Data key.</param>
        /// <returns>Returns object from session.</returns>
        object Get(string key);
        /// <summary>
        /// Method removes an item from the session on demand storage using specified key.
        /// </summary>
        void Remove(string key);
        /// <summary>
        /// Method sets data in the session on demand storage with specified key.
        /// </summary>
        /// <param name="key">Data key.</param>
        /// <param name="value">Data to store.</param>
        void Set(string key, object value);
        /// <summary>
        /// Gets or sets data in the session on demand storage with specified key.
        /// </summary>
        /// <param name="key">Data key.</param>
        object this[string key] { get; set; }
    }
}
